/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vectors;


import Exceptions.IncompatibleVectorSizesException;
import java.util.*;

/**
 *
 * @author Кирилл
 */
public class ProtectedVector implements VectorIn {
  private JArrayList aVector;
   
  public ProtectedVector(VectorIn vector){
      aVector = new JArrayList();
      aVector.objectToVector(vector);
  } 
    @Override
    public void setElement(double value, int index) {
        aVector.setElement(value, index);
    }

    @Override
    public Double getElement(int index) {
     return aVector.getElement(index);
    }

    @Override
    public int getSize() {
     return aVector.getSize();
    }

    @Override
    public void massiveToVector(double[] massive) {
    aVector.massiveToVector(massive);
    }

    @Override
    public void objectToVector(VectorIn Vector1) {
    aVector.objectToVector(Vector1);    
    }

    @Override
    public void multiplyVector(double multiply) {
        aVector.multiplyVector(multiply);
    }

    @Override
    public void vectorPlusVector(VectorIn Vector)throws IncompatibleVectorSizesException {
        aVector.vectorPlusVector(Vector);
    }

    @Override
    public boolean equalsVectors(VectorIn Vector) {
     return aVector.equalsVectors(Vector);
    }

    @Override
    public void add(double value) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public Iterator<Double> iterator() {
      return aVector.iterator();
    }
     @Override
    public boolean equals(Object obj){
        return aVector.equals(obj);
    }
    @Override
    public int hashCode(){
       return aVector.hashCode();
    }
    @Override
    public String toString(){
        return aVector.toString();
    }
  @Override
    public Object clone() throws CloneNotSupportedException{
        ProtectedVector result = null;
       result = (ProtectedVector) super.clone();
       result.aVector = (JArrayList)aVector.clone();
    return result;
    }

    @Override
    public void registerObserver(vectors.Observer o) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void removeObserver(vectors.Observer o) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void elementNotifyObservers(int index) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void updateNotifyObservers() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
